class AddIndexes < ActiveRecord::Migration
  def self.up
    add_index :expenses, :group_id, :name => 'expenses_group_ix'
    add_index :individuals, :payee, :name => 'individuals_payee_ix'
    add_index :individuals, :payer, :name => 'individuals_payer_ix'
    add_index :individuals, :expense_id, :name => 'individuals_expense_ix'
    add_index :users, :group_id, :name => 'users_group_ix'
    add_index :votes, :user_id, :name => 'votes_user_ix'
    add_index :votes, :feedback_id, :name => 'votes_feedback_ix'
  end

  def self.down
    remove_index :expenses, :group_id, :name => 'expenses_group_ix'
    remove_index :individuals, :payee, :name => 'individuals_payee_ix'
    remove_index :individuals, :payer, :name => 'individuals_payer_ix'
    remove_index :individuals, :expense_id, :name => 'individuals_expense_ix'
    remove_index :users, :group_id, :name => 'users_group_ix'
    remove_index :votes, :user_id, :name => 'votes_user_ix'
    remove_index :votes, :feedback_id, :name => 'votes_feedback_ix'
  end
end
